home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / sys / amiga / programmer / 1989 < prev    next >
Mailbox/MIME Entity  |  1996-08-05  |  2.2 KB

open in: MacOS 8.1     |     Win98     |     DOS

browse contents    |     view JSON data     |     view as text


This file was processed as: Mailbox/MIME Entity (archive/mbox).

ConfidenceProgramDetectionMatch TypeSupport
100% dexvert Newsgroup Content (archive/news) magic Supported
100% dexvert Mailbox/MIME Entity (archive/mbox) magic Supported
100% dexvert Internet Message Format (text/imf) magic Supported
1% dexvert Text File (text/txt) fallback Supported
100% file news, ASCII text default
100% checkBytes Printable ASCII default
100% dexmagic PrintFox/Pagefox WEAK default
100% perlTextCheck Likely Text (Perl) default
100% siegfried fmt/950 MIME Email (1.0) default
100% detectItEasy Format: plain text[LF] default (weak)
100% xdgMime message/news default



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 50 61 74 68 3a 20 6d 61 | 69 6c 32 6e 65 77 73 2e |Path: ma|il2news.|
|00000010| 64 65 6d 6f 6e 2e 63 6f | 2e 75 6b 21 62 65 61 63 |demon.co|.uk!beac|
|00000020| 68 79 68 64 2e 64 65 6d | 6f 6e 2e 63 6f 2e 75 6b |hyhd.dem|on.co.uk|
|00000030| 0a 46 72 6f 6d 3a 20 41 | 64 61 6d 40 62 65 61 63 |.From: A|dam@beac|
|00000040| 68 79 68 64 2e 64 65 6d | 6f 6e 2e 63 6f 2e 75 6b |hyhd.dem|on.co.uk|
|00000050| 0a 4e 65 77 73 67 72 6f | 75 70 73 3a 20 63 6f 6d |.Newsgro|ups: com|
|00000060| 70 2e 73 79 73 2e 61 6d | 69 67 61 2e 70 72 6f 67 |p.sys.am|iga.prog|
|00000070| 72 61 6d 6d 65 72 0a 53 | 75 62 6a 65 63 74 3a 20 |rammer.S|ubject: |
|00000080| 4d 6f 72 65 20 6c 69 6e | 6b 65 64 20 6c 69 73 74 |More lin|ked list|
|00000090| 20 6e 6f 6e 73 65 6e 73 | 65 0a 44 61 74 65 3a 20 | nonsens|e.Date: |
|000000a0| 32 34 20 4a 61 6e 20 39 | 36 20 32 33 3a 32 38 3a |24 Jan 9|6 23:28:|
|000000b0| 32 32 20 47 4d 54 0a 4f | 72 67 61 6e 69 7a 61 74 |22 GMT.O|rganizat|
|000000c0| 69 6f 6e 3a 20 42 65 61 | 63 68 79 20 48 65 61 64 |ion: Bea|chy Head|
|000000d0| 20 2d 20 55 4b 0a 4d 65 | 73 73 61 67 65 2d 49 44 | - UK.Me|ssage-ID|
|000000e0| 3a 20 3c 33 31 30 37 31 | 34 66 36 40 62 65 61 63 |: <31071|4f6@beac|
|000000f0| 68 79 68 64 2e 64 65 6d | 6f 6e 2e 63 6f 2e 75 6b |hyhd.dem|on.co.uk|
|00000100| 3e 0a 58 2d 4e 4e 54 50 | 2d 50 6f 73 74 69 6e 67 |>.X-NNTP|-Posting|
|00000110| 2d 48 6f 73 74 3a 20 62 | 65 61 63 68 79 68 64 2e |-Host: b|eachyhd.|
|00000120| 64 65 6d 6f 6e 2e 63 6f | 2e 75 6b 0a 58 2d 46 54 |demon.co|.uk.X-FT|
|00000130| 4e 2d 54 6f 3a 20 4a 65 | 66 66 20 47 72 69 6d 6d |N-To: Je|ff Grimm|
|00000140| 65 74 74 0a 4d 49 4d 45 | 2d 56 65 72 73 69 6f 6e |ett.MIME|-Version|
|00000150| 3a 20 31 2e 30 0a 43 6f | 6e 74 65 6e 74 2d 54 79 |: 1.0.Co|ntent-Ty|
|00000160| 70 65 3a 20 74 65 78 74 | 2f 70 6c 61 69 6e 3b 20 |pe: text|/plain; |
|00000170| 63 68 61 72 73 65 74 3d | 69 73 6f 2d 38 38 35 39 |charset=|iso-8859|
|00000180| 2d 31 0a 43 6f 6e 74 65 | 6e 74 2d 54 72 61 6e 73 |-1.Conte|nt-Trans|
|00000190| 66 65 72 2d 45 6e 63 6f | 64 69 6e 67 3a 20 38 62 |fer-Enco|ding: 8b|
|000001a0| 69 74 0a 58 2d 47 61 74 | 65 53 6f 66 74 77 61 72 |it.X-Gat|eSoftwar|
|000001b0| 65 3a 20 41 6d 69 47 61 | 74 65 20 31 2e 36 20 28 |e: AmiGa|te 1.6 (|
|000001c0| 31 33 2e 31 31 2e 39 35 | 29 0a 4d 4d 44 46 2d 57 |13.11.95|).MMDF-W|
|000001d0| 61 72 6e 69 6e 67 3a 20 | 20 50 61 72 73 65 20 65 |arning: | Parse e|
|000001e0| 72 72 6f 72 20 69 6e 20 | 6f 72 69 67 69 6e 61 6c |rror in |original|
|000001f0| 20 76 65 72 73 69 6f 6e | 20 6f 66 20 70 72 65 63 | version| of prec|
|00000200| 65 64 69 6e 67 20 6c 69 | 6e 65 20 61 74 20 72 65 |eding li|ne at re|
|00000210| 6c 61 79 2d 34 2e 6d 61 | 69 6c 2e 64 65 6d 6f 6e |lay-4.ma|il.demon|
|00000220| 2e 6e 65 74 0a 58 2d 4d | 61 69 6c 32 4e 65 77 73 |.net.X-M|ail2News|
|00000230| 2d 50 61 74 68 3a 20 72 | 65 6c 61 79 2d 34 2e 6d |-Path: r|elay-4.m|
|00000240| 61 69 6c 2e 64 65 6d 6f | 6e 2e 6e 65 74 21 70 6f |ail.demo|n.net!po|
|00000250| 73 74 2e 64 65 6d 6f 6e | 2e 63 6f 2e 75 6b 21 62 |st.demon|.co.uk!b|
|00000260| 65 61 63 68 79 68 64 2e | 64 65 6d 6f 6e 2e 63 6f |eachyhd.|demon.co|
|00000270| 2e 75 6b 0a 0a 49 6e 20 | 61 20 6d 65 73 73 61 67 |.uk..In |a messag|
|00000280| 65 20 6f 66 20 32 34 20 | 4a 61 6e 20 39 36 20 4a |e of 24 |Jan 96 J|
|00000290| 65 66 66 20 47 72 69 6d | 6d 65 74 74 20 77 72 6f |eff Grim|mett wro|
|000002a0| 74 65 20 74 6f 20 41 6c | 6c 3a 0a 0a 20 4a 47 3e |te to Al|l:.. JG>|
|000002b0| 20 49 74 20 6a 75 73 74 | 20 6f 63 63 75 72 72 65 | It just| occurre|
|000002c0| 64 20 74 6f 20 6d 65 20 | 6c 61 73 74 20 6e 69 67 |d to me |last nig|
|000002d0| 68 74 2c 20 61 73 20 49 | 20 70 6f 72 65 64 20 6f |ht, as I| pored o|
|000002e0| 76 65 72 20 73 74 65 61 | 6d 69 6e 67 20 63 6f 64 |ver stea|ming cod|
|000002f0| 65 2c 20 74 68 61 74 20 | 0a 20 4a 47 3e 20 74 68 |e, that |. JG> th|
|00000300| 65 20 66 75 6e 63 74 69 | 6f 6e 20 52 65 6d 6f 76 |e functi|on Remov|
|00000310| 65 28 29 20 28 75 73 65 | 64 20 74 6f 20 72 65 6d |e() (use|d to rem|
|00000320| 6f 76 65 20 6e 6f 64 65 | 73 20 66 72 6f 6d 20 6c |ove node|s from l|
|00000330| 69 6e 6b 65 64 20 6c 69 | 73 74 73 29 20 6d 69 67 |inked li|sts) mig|
|00000340| 68 74 20 0a 20 4a 47 3e | 20 50 4f 53 53 49 42 4c |ht . JG>| POSSIBL|
|00000350| 59 20 6e 6f 74 20 62 65 | 20 66 72 65 65 69 6e 67 |Y not be| freeing|
|00000360| 20 74 68 65 20 6d 65 6d | 6f 72 79 20 61 6c 6c 6f | the mem|ory allo|
|00000370| 63 61 74 65 64 20 74 6f | 20 74 68 65 20 6e 6f 64 |cated to| the nod|
|00000380| 65 20 69 74 20 69 73 0a | 20 4a 47 3e 20 72 65 6d |e it is.| JG> rem|
|00000390| 6f 76 69 6e 67 2e 0a 0a | 59 6f 75 20 61 72 65 20 |oving...|You are |
|000003a0| 63 6f 72 72 65 63 74 2c | 20 69 74 20 64 6f 65 73 |correct,| it does|
|000003b0| 6e 27 74 20 64 65 61 6c | 6c 6f 63 61 74 65 20 74 |n't deal|locate t|
|000003c0| 68 65 20 6d 65 6d 6f 72 | 79 2e 20 54 68 65 72 65 |he memor|y. There|
|000003d0| 20 61 72 65 20 76 65 72 | 79 20 67 6f 6f 64 20 72 | are ver|y good r|
|000003e0| 65 61 73 6f 6e 73 0a 66 | 6f 72 20 74 68 69 73 21 |easons.f|or this!|
|000003f0| 0a 0a 59 6f 75 20 6d 69 | 67 68 74 20 6e 6f 74 20 |..You mi|ght not |
|00000400| 62 65 20 75 73 69 6e 67 | 20 61 20 70 75 72 65 20 |be using| a pure |
|00000410| 4e 6f 64 65 20 73 74 72 | 75 63 74 75 72 65 2c 20 |Node str|ucture, |
|00000420| 62 75 74 20 69 6e 73 74 | 65 61 64 20 61 6e 6f 74 |but inst|ead anot|
|00000430| 68 65 72 20 73 74 72 75 | 63 74 75 72 65 0a 74 68 |her stru|cture.th|
|00000440| 61 74 20 63 6f 6e 74 61 | 69 6e 73 20 74 68 65 20 |at conta|ins the |
|00000450| 72 69 67 68 74 20 66 69 | 65 6c 64 73 20 74 6f 20 |right fi|elds to |
|00000460| 62 65 20 75 73 65 64 20 | 77 69 74 68 20 65 78 65 |be used |with exe|
|00000470| 63 27 73 20 6c 69 6e 6b | 65 64 20 6c 69 73 74 73 |c's link|ed lists|
|00000480| 2e 20 49 66 20 73 6f 2c | 20 79 6f 75 0a 6d 69 67 |. If so,| you.mig|
|00000490| 68 74 20 6e 65 65 64 20 | 74 6f 20 66 72 65 65 20 |ht need |to free |
|000004a0| 6d 65 6d 6f 72 79 20 6f | 72 20 70 65 72 66 6f 72 |memory o|r perfor|
|000004b0| 6d 20 6f 74 68 65 72 20 | 6f 70 65 72 61 74 69 6f |m other |operatio|
|000004c0| 6e 73 20 6f 6e 20 61 20 | 6e 6f 64 65 20 74 68 61 |ns on a |node tha|
|000004d0| 74 20 68 61 73 20 62 65 | 65 6e 0a 52 65 6d 6f 76 |t has be|en.Remov|
|000004e0| 65 28 29 27 64 2c 20 62 | 65 66 6f 72 65 20 66 72 |e()'d, b|efore fr|
|000004f0| 65 65 69 6e 67 20 69 74 | 2e 0a 0a 59 6f 75 20 6d |eeing it|...You m|
|00000500| 69 67 68 74 20 70 6f 73 | 73 69 62 6c 79 20 2a 6e |ight pos|sibly *n|
|00000510| 6f 74 2a 20 77 61 6e 74 | 20 74 6f 20 66 72 65 65 |ot* want| to free|
|00000520| 20 74 68 65 20 6d 65 6d | 6f 72 79 2c 20 62 75 74 | the mem|ory, but|
|00000530| 20 69 6e 73 74 65 61 64 | 20 28 66 6f 72 20 65 78 | instead| (for ex|
|00000540| 61 6d 70 6c 65 29 0a 61 | 64 64 69 6e 67 20 69 74 |ample).a|dding it|
|00000550| 20 62 61 63 6b 20 74 6f | 20 61 20 6c 69 73 74 2c | back to| a list,|
|00000560| 20 65 74 63 2e 0a 0a 20 | 4a 47 3e 20 44 6f 65 73 | etc... |JG> Does|
|00000570| 20 61 6e 79 6f 6e 65 20 | 68 61 76 65 20 73 6f 6d | anyone |have som|
|00000580| 65 20 69 6e 73 69 67 68 | 74 20 6f 6e 20 74 68 69 |e insigh|t on thi|
|00000590| 73 3f 20 20 49 74 27 73 | 20 64 69 66 66 69 63 75 |s? It's| difficu|
|000005a0| 6c 74 20 74 6f 0a 20 4a | 47 3e 20 64 65 61 6c 6c |lt to. J|G> deall|
|000005b0| 6f 63 61 74 65 20 61 20 | 20 6e 6f 64 65 20 6f 6e |ocate a | node on|
|000005c0| 63 65 20 69 74 27 73 20 | 6e 6f 74 20 70 61 72 74 |ce it's |not part|
|000005d0| 20 6f 66 20 74 68 65 20 | 6c 69 73 74 2c 20 62 75 | of the |list, bu|
|000005e0| 74 20 69 74 27 73 20 70 | 72 65 74 74 79 0a 20 4a |t it's p|retty. J|
|000005f0| 47 3e 20 53 54 55 50 49 | 44 20 74 6f 20 66 72 65 |G> STUPI|D to fre|
|00000600| 65 20 69 74 20 20 42 45 | 46 4f 52 45 2e 20 3a 2d |e it BE|FORE. :-|
|00000610| 29 0a 0a 41 6c 6c 20 79 | 6f 75 20 6e 65 65 64 20 |)..All y|ou need |
|00000620| 69 73 20 73 6f 6d 65 74 | 68 69 6e 67 20 6c 69 6b |is somet|hing lik|
|00000630| 65 20 74 68 69 73 3a 0a | 0a 0a 20 76 6f 69 64 20 |e this:.|.. void |
|00000640| 66 72 65 65 5f 61 6e 64 | 5f 64 65 61 6c 6c 6f 63 |free_and|_dealloc|
|00000650| 61 74 65 5f 6e 6f 64 65 | 28 73 74 72 75 63 74 20 |ate_node|(struct |
|00000660| 4e 6f 64 65 20 2a 6d 79 | 6e 6f 64 65 29 0a 20 7b |Node *my|node). {|
|00000670| 0a 20 20 20 20 52 65 6d | 6f 76 65 28 6d 79 6e 6f |. Rem|ove(myno|
|00000680| 64 65 29 3b 20 20 20 2f | 2f 20 72 65 6d 6f 76 65 |de); /|/ remove|
|00000690| 20 6d 79 6e 6f 64 65 20 | 66 72 6f 6d 20 74 68 65 | mynode |from the|
|000006a0| 20 6c 69 73 74 0a 20 20 | 20 20 46 72 65 65 56 65 | list. | FreeVe|
|000006b0| 63 28 6d 79 6e 6f 64 65 | 29 3b 20 20 2f 2f 20 66 |c(mynode|); // f|
|000006c0| 72 65 65 20 74 68 65 20 | 6d 65 6d 6f 72 79 20 66 |ree the |memory f|
|000006d0| 6f 72 20 6d 79 6e 6f 64 | 65 0a 20 7d 0a 0a 0a 59 |or mynod|e. }...Y|
|000006e0| 6f 75 20 6d 75 73 74 20 | 72 65 6d 6f 76 65 20 74 |ou must |remove t|
|000006f0| 68 65 20 6e 6f 64 65 20 | 66 72 6f 6d 20 74 68 65 |he node |from the|
|00000700| 20 6c 69 73 74 20 62 65 | 66 6f 72 65 20 79 6f 75 | list be|fore you|
|00000710| 20 66 72 65 65 20 69 74 | 21 20 46 72 65 65 69 6e | free it|! Freein|
|00000720| 67 20 74 68 65 20 6d 65 | 6d 6f 72 79 0a 64 6f 65 |g the me|mory.doe|
|00000730| 73 20 6e 6f 74 20 61 74 | 20 61 6c 6c 20 67 75 61 |s not at| all gua|
|00000740| 72 61 6e 74 65 65 20 74 | 68 61 74 20 74 68 65 20 |rantee t|hat the |
|00000750| 64 61 74 61 20 74 68 61 | 74 20 77 61 73 20 63 6f |data tha|t was co|
|00000760| 6e 74 61 69 6e 65 64 20 | 77 69 6c 6c 20 62 65 20 |ntained |will be |
|00000770| 6c 65 66 74 20 69 6e 74 | 61 63 74 0a 28 69 6e 20 |left int|act.(in |
|00000780| 66 61 63 74 2c 20 69 74 | 20 6d 6f 72 65 20 6f 72 |fact, it| more or|
|00000790| 20 6c 65 73 73 20 67 75 | 61 72 61 6e 74 65 65 73 | less gu|arantees|
|000007a0| 20 74 68 61 74 20 74 68 | 65 20 6f 6c 64 20 64 61 | that th|e old da|
|000007b0| 74 61 20 77 69 6c 6c 20 | 62 65 63 6f 6d 65 20 69 |ta will |become i|
|000007c0| 6e 76 61 6c 69 64 29 2e | 0a 0a 4f 6e 63 65 20 79 |nvalid).|..Once y|
|000007d0| 6f 75 20 68 61 76 65 20 | 72 65 6d 6f 76 65 64 20 |ou have |removed |
|000007e0| 74 68 65 20 6e 6f 64 65 | 2c 20 79 6f 75 20 6e 6f |the node|, you no|
|000007f0| 77 20 6a 75 73 74 20 68 | 61 76 65 20 61 6e 20 69 |w just h|ave an i|
|00000800| 73 6f 6c 61 74 65 64 20 | 6e 6f 64 65 2e 20 49 74 |solated |node. It|
|00000810| 27 73 20 6e 6f 74 0a 61 | 74 74 61 63 68 65 64 20 |'s not.a|ttached |
|00000820| 74 6f 20 61 6e 79 20 6c | 69 6e 6b 73 2c 20 62 75 |to any l|inks, bu|
|00000830| 74 20 69 74 27 73 20 73 | 74 69 6c 6c 20 61 20 70 |t it's s|till a p|
|00000840| 65 72 66 65 63 74 6c 79 | 20 76 61 6c 69 64 20 6e |erfectly| valid n|
|00000850| 6f 64 65 2e 20 41 74 20 | 74 68 69 73 20 70 6f 69 |ode. At |this poi|
|00000860| 6e 74 20 79 6f 75 0a 66 | 72 65 65 20 69 74 73 20 |nt you.f|ree its |
|00000870| 6d 65 6d 6f 72 79 2c 20 | 61 6e 64 20 74 68 65 6e |memory, |and then|
|00000880| 20 66 6f 72 67 65 74 20 | 69 74 20 65 76 65 72 20 | forget |it ever |
|00000890| 65 78 69 73 74 65 64 2e | 0a 0a 2e 5c 64 61 6d 2e |existed.|...\dam.|
|000008a0| 20 20 20 20 20 20 20 20 | 20 20 5b 54 65 61 6d 20 | | [Team |
|000008b0| 41 4d 49 47 41 5d 20 20 | 20 20 20 20 20 20 20 20 |AMIGA] | |
|000008c0| 2f 2f 5c 20 61 64 33 32 | 40 62 72 69 67 68 74 6f |//\ ad32|@brighto|
|000008d0| 6e 2e 61 63 2e 75 6b 20 | 5c 5c 2f 0a 0a |n.ac.uk |\\/.. |
+--------+-------------------------+-------------------------+--------+--------+